<template>
  <van-swipe class="my-swipe" :autoplay="3000" indicator-color="white">
    <van-swipe-item v-for="obj in imgs" :key="obj.bannerid">
      <img :src="obj.img" />
    </van-swipe-item>
  </van-swipe>
</template>

<script>
export default {
  name: "BannerBar",
  data() {
    return {
      imgs: [],
    };
  },
  created() {
    this.service({
      url: "/banner/list",
    }).then((res) => {
      if (res.data.code == 200) {
        this.imgs = res.data.data;
      }
        
    });
  },
  methods: {},
};
</script>

<style scoped>
.my-swipe .van-swipe-item {
  color: #fff;
  height: 100%;
  font-size: 1.25rem;
  /* line-height: 150px; */
  text-align: center;
  /* background-color: #39a9ed; */
}
.my-swipe img {
  width: 100%;
  height: 100%;
}
</style>